package iosr11.contact.dao;

import iosr11.data.Group;
import iosr11.data.User;

import java.net.URL;
import java.util.List;

import com.google.gdata.client.contacts.ContactsService;
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.ContactGroupEntry;

public interface ContactsHelper {
	public boolean addUser(User user);
	public User getUser(String name);
	public User getUserByRef(String ref);
	public boolean updateUser(User user);
	public boolean deleteUser(ContactEntry user);
	
	public boolean addGroup(Group group);
	public Group getGroupByRef(String ref);
	public boolean deleteGroup(Group group);
	public boolean updateGroup(Group group);
	public Group getGroup(String title);
	public List<Group> getUserGroups(User user);
	public boolean addUserToGroup(User user, Group group);
	
	public User rewrite(ContactEntry entry);
	public ContactEntry rewrite(User user);
	public Group rewrite(ContactGroupEntry entry);
	public ContactGroupEntry rewrite(Group group);
	
	public ContactsService getService();
	public void setService(ContactsService service, String username);
	public boolean autenticate(String username, String password);
	public boolean addNewUser(ContactEntry user);
	public boolean addNewUser(String realUserName, String email);
	public String addNewUserReturnId(String realUserName, String email);
	public String addNewUserReturnId(ContactEntry user);
	public boolean addUserGroup(ContactEntry contact, ContactGroupEntry group);
	public boolean addUserGroup(ContactEntry contact, String groupName);
	public ContactEntry getUser(URL url);
	public ContactEntry getUserOld(String name);
	public boolean deleteUser(String id);
}
